x86: correct socket_cpumask allocation
authorChao Peng <chao.p.peng@linux.intel.com>
Thu, 9 Jul 2015 15:47:26 +0000 (17:47 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 9 Jul 2015 15:47:26 +0000 (17:47 +0200)
commit8b3776abe6b2accf1ffea625843ad40cd42bab96
treef6a37798c6cde65e559dba0ea3fc87344ca084e2
parent85e972bf71fd26e5db78a73a3d46587ce8940c28
x86: correct socket_cpumask allocation

For booting cpu, the socket number is not needed to be 0 so
it needs to be computed by cpu number.

For secondary cpu, phys_proc_id is not valid in CPU_PREPARE
notifier(cpu_smpboot_alloc), so cpu_to_socket(cpu) can't be used.
Instead, pre-allocate secondary_cpu_mask in cpu_smpboot_alloc()
and later consume it in smp_store_cpu_info().

This patch also change socket_cpumask type from 'cpumask_var_t *'
to 'cpumask_t **' so that smaller NR_CPUS works.

Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
Tested-by: Dario Faggioli <dario.faggioli@citrix.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
xen/arch/x86/smpboot.c
xen/include/asm-x86/smp.h